package com.lorenzogao.pley.ui.adapter

import android.widget.ImageView
import com.bumptech.glide.Glide
import com.chad.library.adapter.base.BaseQuickAdapter
import com.chad.library.adapter.base.BaseViewHolder
import com.lorenzogao.pley.R
import com.lorenzogao.pley.bean.Category
import com.lorenzogao.pley.common.Constant

/**
 * 作者：Lorenzo Gao
 * Date: 2018/1/8
 * Time: 9:58
 * 邮箱：2508719070@qq.com
 * Description:
 */
class CategoryAdapter : BaseQuickAdapter<Category, BaseViewHolder>(R.layout.template_category) {


    override fun convert(helper: BaseViewHolder, item: Category) {
        helper.setText(R.id.tv_category_title, item.name)

        var iv_icon = helper.getView(R.id.iv_category_icon) as ImageView
        Glide.with(iv_icon.context).load(Constant.BASEURL + item.icon).into(iv_icon)
    }

}